import { ArgumentMetadata, PipeTransform, Injectable, } from "@nestjs/common";

// 服务
import { AppService } from './app.service'

/**
 * 全局管道 依赖注入
 */
@Injectable()
export class MyPipe implements PipeTransform {
  constructor(private readonly appService: AppService) {

  }

  transform(value: any, metadata: ArgumentMetadata) {
    console.log('全局管道内的依赖注入 ', this.appService.log)
    return value
  }
  
}
